# def fahrenheit_to_celsius(fahrenheit, unit="C"):
#     celsius = 5 / 9 * (fahrenheit - 32)
#     print(f"华氏{fahrenheit}度转换成摄氏度为：{celsius:.1f}{unit}")
#     return celsius


# def celsius_to_fahrenheit(celsius, unit="F"):
#     fahrenheit = (celsius + 32) * 9 / 5
#     print(f"摄氏{celsius}度转换成华氏度为：{fahrenheit:.1f}{unit}")
#     return fahrenheit


# def convert_temp(temp, operation):
#     return operation(temp)


# t = 200
# f1 = convert_temp(t, celsius_to_fahrenheit)
# c1 = convert_temp(t, fahrenheit_to_celsius)


# def cny_to_jpy(amount):
#     jpy = amount * 20
#     print(f"{amount}人民币转换成日元为：{jpy:.1f}日元")
#     return jpy


# def jpy_to_cny(amount):
#     cny = amount / 20
#     print(f"{amount}日元转换成人民币为：{cny:.1f}人民币")
#     return cny


# def cny_to_usd(amount):
#     usd = amount * 0.14
#     print(f"{amount}人民币转换成美元：{usd:.1f}美元")
#     return usd


# def usd_to_cny(amount):
#     cny = amount / 0.14
#     print(f"{amount}美元转换成人民币为：{cny:.1f}人民币")
#     return cny


# def currency_converter(amount, operation):
#     return operation(amount)


# def currency_converter1(amount, operation1, operation2):
#     return operation2(operation1(amount))


# def usd_to_jpy(amount_usd, operation1=usd_to_cny, operation2=cny_to_jpy):
#     return operation2(operation1(amount_usd))


# # amount_cny=100
# # jpy=currency_converter(amount_cny,cny_to_jpy)
# # usd=currency_converter(amount_cny,cny_to_usd)
# amount_usd = 100
# jpy = usd_to_jpy(amount_usd)
# cny=currency_converter(amount_usd,usd_to_cny)


# def convert(conv):

#     def cny_to_jpy(amount):
#         print(f"{amount}人民币转换成日元为：{jpy:.1f}日元")
#         return jpy

#     def jpy_to_cny(amount):
#         print(f"{amount}日元转换成人民币为：{cny:.1f}人民币")
#         return cny

#     if amount < 1000:
#         return cny_to_jpy
#     else:
#         return jpy_to_cny


def Notify(operation):
    # def wrapper(x)
    def wrapper(*args, **kwargs):
        print("开始转换....")
        operation(*args)
        # res=operation(x)
        print("结束转换....")
        # return f"膨胀10倍{res * 10}"

    return wrapper


@Notify
def usd_to_cny(amount):
    cny = amount / 0.14
    print(f"{amount}美元转换成人民币为：{cny:.1f}人民币")
    return cny


@Notify
def jpy_to_cny(amount):
    cny = amount / 20
    print(f"{amount}日元转换成人民币为：{cny:.1f}人民币")
    return cny


def cny_to_jpy(amount):
    jpy = amount * 20
    print(f"{amount}人民币转换成日元为：{jpy:.1f}日元")
    return jpy


usd_to_cny(100)
# print(usd_to_cny(100))

jpy_to_cny(100)

cny_to_jpy(100)
